package com.desktopmng.orm;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
@Table(name = "JFOSS2_DESK_DESKTOP_CONTENT")
public class DesktopContent extends BaseObject {

	public DesktopContent() {
	};

	@Id
	@Column(name = "DSTC_ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	/**
	 * 桌面内容编号
	 */
	private Long dstcId;

	@Column(name = "BASE_CONTENT", length = 4000, nullable = false, unique = false)
	/**
	 * 布局内容
	 */
	private String baseContent;

	@Column(name = "DSTC_NAME", length = 200, nullable = false, unique = false)
	/**
	 * 桌面内容名称
	 */
	private String dstcName;

	@Column(name = "JS_CONTENT", length = 1000, nullable = true, unique = false)
	/**
	 * JavaScript内容
	 */
	private String jsContent;

	@Column(name = "DATA_INFO", length = 2000, nullable = true, unique = false)
	/**
	 * 数据信息
	 */
	private String dataInfo;

	@Column(name = "DATA_SOURCE", length = 10, nullable = true, unique = false)
	/**
	 * 数据源
	 */
	private String dataSource;

	@Column(name = "DATA_COUNT",  nullable = true, unique = false)
	/**
	 * 显示数据记录数
	 */
	private Integer dataCount;

	@Column(name = "LINK_URL", length = 300, nullable = true, unique = false)
	/**
	 * 链接路径
	 */
	private String linkUrl;

	@Column(name = "DIV_ID", length = 50, nullable = true, unique = false)
	/**
	 * HTML元素ID
	 */
	private String divId;

	@Column(name = "DISPLAY_TYPE", length = 10, nullable = true, unique = false)
	/**
	 * 显示数据类型
	 */
	private String displayType;

	@Column(name = "PARAMS", length = 200, nullable = true, unique = false)
	/**
	 * 参数名
	 */
	private String params;

	@Column(name = "POS_ROWS",nullable = true)
	/**
	 * 横向位置
	 */
	private Integer posRows;

	@Column(name = "POS_COLS",nullable = true )
	/**
	 * 纵向位置
	 */
	private Integer posCols;

	@Column(name = "STATUS", length = 1, nullable = true, unique = false)
	/**
	 * 状态
	 */
	private String status;

	@Temporal(TemporalType.DATE)
	@Column(name = "LASTUPDATE_TIME")
	/**
	 * 最后修改时间
	 */
	private Date lastupdateTime;

	@Temporal(TemporalType.DATE)
	@Column(name = "CREATE_TIME")
	/**
	 * 创建时间
	 */
	private Date createTime;

	@Column(name = "REMARK", length = 1000, nullable = true, unique = false)
	/**
	 * 备注
	 */
	private String remark;

	@Column(name = "TITLE_URL", length = 300, nullable = true, unique = false)
	/**
	 * 标题链接
	 */
	private String titleUrl;

	@Column(name = "RESOURCE_NAME", length = 200, nullable = true, unique = false)
	/**
	 * 所属资源模块名称
	 */
	private String resourceName;

	public String getBaseContent() {
		return baseContent;
	}

	public void setBaseContent(String baseContent) {
		this.baseContent = baseContent;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getDataCount() {
		return dataCount;
	}

	public void setDataCount(Integer dataCount) {
		this.dataCount = dataCount;
	}

	public String getDataInfo() {
		return dataInfo;
	}

	public void setDataInfo(String dataInfo) {
		this.dataInfo = dataInfo;
	}

	public String getDataSource() {
		return dataSource;
	}

	public void setDataSource(String dataSource) {
		this.dataSource = dataSource;
	}

	public String getDisplayType() {
		return displayType;
	}

	public void setDisplayType(String displayType) {
		this.displayType = displayType;
	}

	public String getDivId() {
		return divId;
	}

	public void setDivId(String divId) {
		this.divId = divId;
	}

	public Long getId() {
		return dstcId;
	}

	public void setId(Long dstcId) {
		this.dstcId = dstcId;
	}

	public String getDstcName() {
		return dstcName;
	}

	public void setDstcName(String dstcName) {
		this.dstcName = dstcName;
	}

	public String getJsContent() {
		return jsContent;
	}

	public void setJsContent(String jsContent) {
		this.jsContent = jsContent;
	}

	public Date getLastupdateTime() {
		return lastupdateTime;
	}

	public void setLastupdateTime(Date lastupdateTime) {
		this.lastupdateTime = lastupdateTime;
	}

	public String getLinkUrl() {
		return linkUrl;
	}

	public void setLinkUrl(String linkUrl) {
		this.linkUrl = linkUrl;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public Integer getPosCols() {
		return posCols;
	}

	public void setPosCols(Integer posCols) {
		this.posCols = posCols;
	}

	public Integer getPosRows() {
		return posRows;
	}

	public void setPosRows(Integer posRows) {
		this.posRows = posRows;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTitleUrl() {
		return titleUrl;
	}

	public void setTitleUrl(String titleUrl) {
		this.titleUrl = titleUrl;
	}
	
	public boolean equals(Object object) {
		if (this == object)
			return true;
		if (object == null)
			return false;
		if (DesktopContent.class.isInstance(object)) {
			DesktopContent peer = (DesktopContent) object;
			if (this.getId().equals(peer.getId())) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}

	public int hashCode() {
		StringBuffer sb = new StringBuffer();
		sb.append("DesktopContent:").append(this.getId());
		return sb.toString().hashCode();
	}
}
